<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="author" content="Lei Shi">
		<meta http-equiv="Cache-Control" content="o-transform">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<title>帖子详情 - 智慧教育平台</title>

		<link rel="shortcut icon" href="favicon.ico">
		<link rel="stylesheet" href="../static/font-awesome//4.7.0/css/font-awesome.min.css">
		<link rel="stylesheet" href="../static/highlight.js/9.8.0/monokai-sublime.min.css">
		<link rel="stylesheet" href="../app/css/libs/bootstrap/3.3.7/css/bootstrap.min.css">
		<link rel="stylesheet" href="../app/css/libs/katex/0.6.0/katex.min.css">
		<link rel="stylesheet" href="../app/css/libs/videojs/5.11.7/video-js.min.css">
		<link rel="stylesheet" href="../app/css/dest/styles.css?=2016121272249">

		<link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.min.css">
		<link rel="stylesheet" type="text/css" href="../css/muke.css">
		<link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
		<link rel="stylesheet" href="../css/index.css" />
		<script type="text/javascript" src="../js/jquery.SuperSlide.2.1.1.js"></script>
		<script src="../layui/layui.js"></script>
		<script src="../js/jquery.min.js"></script>
		<script src="../js/vue.min.js"></script>
		<script src="../js/axios.js"></script>
		<script src="../js/index.js"></script>

		<style>

			/* modal 模态框*/
        #invite-user .modal-body {
            overflow: hidden;
        }
		#invite-user .modal-body .form-label {
			margin-bottom: 16px;
			font-size:14px;
		}
		#invite-user .modal-body .form-invite {
			width: 80%;
			padding: 6px 12px;
			background-color: #eeeeee;
			border: 1px solid #cccccc;
			border-radius: 5px;
			float: left;
			margin-right: 10px;
		}
		#invite-user .modal-body .msg-modal-style {
			background-color: #7dd383;
			margin-top: 10px;
			padding: 6px 0;
			text-align: center;
			width: 100%;
		}
		#invite-user .modal-body .modal-flash {
			position: absolute;
			top: 53px;
			right: 74px;
			z-index: 999;
		}
		/* end modal */

        .en-footer {
            padding: 30px;
            text-align: center;
            font-size: 14px;
        }
    </style>

		<script type="text/javascript">
			layui.use('layedit', function() {
				var layedit = layui.layedit,
					$ = layui.jquery;
				var index = layedit.build('demo'); //建立编辑器

				var replyText;
				var active = {
					content: function() {
						replyText = layedit.getContent(index);
						//alert(layedit.getContent(index)); //获取编辑器内容
					},
					text: function() {
						alert(layedit.getText(index)); //获取编辑器纯文本内容
					},
					selection: function() {
						alert(layedit.getSelection(index));
					}
				};

				$("#commit").on('click', function() {
					var type = $(this).data('type');
					active[type] ? active[type].call(this) : '';

					if (replyText == "") {
						layer.msg("请填写回复内容", {
							icon: 5
						});
						return;
					} else {
						$.ajax({
							url: '/api/bbs/reply/insertReply',
							type: 'post',
							data: {
								replyContent: replyText,
								postId: sessionStorage.getItem("postId"),
								userId: sessionStorage.getItem("userid"),
								pId: 0
							},
							headers: {
								'Authorization': 'bearer ' + sessionStorage.getItem("access_token")

							},
							beforeSend: function(request) {
								// 禁用按钮防止重复提交
								$("#commit").attr({
									disabled: "disabled"
								});
								//设置请求头
								//request.setRequestHeader("BBG-Key", "ab9ef204-3253-49d4-b229-3cc2383480a6");
							},
							success: function(data) {
								if (data.success) {
									layer.msg(data.message, {
										icon: 6, //成功的表情 
										time: 1000, //1秒关闭（如果不配置，默认是3秒） 
									}, function() {
										location.reload();
									});

								} else {
									layer.msg(data.message, {
										icon: 5,
										time: 1000,
									});
									//失败的表情 
									return;
								}
							},

						});
					}
				});

			});
		</script>


	</head>

	<body>


		<!-- 顶部 -->
		<div class="width100 float_l img_backg1" style="margin-top: -70px;" id="bt">
			<div class="width100 float_l height80 line_hei80">
				<div class="float_l">
					<div class="float_l margin_l20">
						<a href="../../student/index.html"> <img src="../img/uiz1.png"></a>
					</div>
					<div class="float_l">
						<ul class="ul_li fon_siz16">
							<li><a class="color_black" href="../../student/curricular/courses/index.html">课程</a></li>
							<li><a class="color_black" href="../../student/department.html">院系</a></li>
							<li><a class="color_black" href="../../student/curricular/paths/index.html">名师专栏</a></li>

						</ul>
					</div>
				</div>

				<div class="float_r">
					<div class="float_l top_input">
						<input class="posi_relative" type="text" name="" id="" placeholder="请输入想搜索的内容...">
						<img class="img_sousuo bianshou" src="../img/uiz4.png">
					</div>
					<div class="float_l margin_l20">
						<img src="../img/uiz5.png">
					</div>
					<div class="float_l margin_l35">
						<img src="../img/uiz6.png">
					</div>
					<div class="float_l margin_l30 margin_r40">
						<a class="color_black" href="../../student/curricular/user/13/course.html" v-show="isCenter">个人中心</a>&nbsp;&nbsp;
						<a class="btn btn-default navbar-btn sign-in" href="javascript:void(0)" @click="login()" v-show="isShow">登录</a>
						<el-dropdown>
							<div class="color_black" v-show="isCenter">
								<img :src="userPhoto" width="45px">
								<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
							</div>
							<el-dropdown-menu slot="dropdown">
								<el-dropdown-item @click.native="shezhi()">设置</el-dropdown-item>
								<el-dropdown-item @click.native="tuichu()">退出</el-dropdown-item>
							</el-dropdown-menu>
						</el-dropdown>
					</div>

				</div>

			</div>
		</div>

		<script type="text/javascript">
			var bt = new Vue({
				el: "#bt",
				mounted: function() {
					var roleNames = sessionStorage.getItem("roleNames");
					console.log(roleNames);
					if (roleNames != null && roleNames == ("学生")) {
						this.isShow = false;
						this.isCenter = true;
						this.userPhoto = sessionStorage.getItem("userPhoto");
					}

				},
				data: {
					isShow: true,
					isCenter: false,
					userPhoto: '',
				},
				methods: {
					login: function() {
						window.location.href = "http://127.0.0.1/login.html";
					},
					tuichu: function() {
						sessionStorage.clear();
						localStorage.clear();
						window.location.href = "http://127.0.0.1/login.html";
					},
					shezhi: function() {
						window.location.href = "/student/curricular/user/13/personal.html";
					}
				}
			});
		</script>



		<div class="container layout layout-margin-top">

			<ol class="breadcrumb">
				<li><a href="post.html">讨论区</a></li>
				<li><a href="#">帖子详情</a></li>
			</ol>

			<div class="row" id="postDetails">
				<div class="col-md-9 layout-body">

					<div class="content question-detail">
						<div class="question-headline">
							<span class="question-title" v-if="isDelete"> 该贴已被删除，不能查看</span>
							<span class="question-title" v-else> {{postTitle}}</span>
							<span class="question-figure">{{postBrowse}} 查看</span>
							<span class="question-figure">{{replynum}} 回复</span>
						</div>
						<div class="question-author">
							<div class="user-avatar ">
								<!-- 发帖人头像 -->
								<a class="avatar" href="#" target="_blank">
									<img :src="userImg">
								</a>
							</div>
							<div class="user-username ">
								<a class="username" href="#" target="_blank"> {{postUsername}} </a>
							</div>

							<span>{{postTime}}</span>

						</div>
						<div class="question-content markdown-body">
							<p v-if="isDelete">该贴已被删除，不能查看</p>
							<p v-else>{{postContent}}</p>
							<div class="labreport-detail-like">
								<!-- 回复 -->
								<span class="btn btn-weiboshare">
									<template>
										<el-button size="mini" @click="sadasd" type="success" plain>回复</el-button>
									</template>
								</span>

								<!-- 举报 -->
								<span class="btn  btn-weiboshare" v-if="postReport">
									<el-button type="warning" size="mini" disabled>举报</el-button>
								</span>
								<span class="btn  btn-weiboshare" v-else>
									<el-button type="warning" size="mini" @click="userReportPost()">举报</el-button>
								</span>
								<!-- 删除 -->
								<span class="btn  btn-weiboshare" v-if="isMy">
									<i class="layui-icon layui-icon-delete" v-on:click="deletePost()" style="font-size: 20px; color: #CC0033;"></i>
								</span>

								<!-- 点赞 -->
								<span class="btn  btn-weiboshare" v-if="postLike">
									<i class="layui-icon layui-icon-praise" v-on:click="userLikePost()" style="font-size: 20px; color: #CC0033;"></i>
								</span>
								<span class="btn  btn-weiboshare" v-else>
									<i class="layui-icon layui-icon-praise" v-on:click="userLikePost()" style="font-size: 20px; color: #6D6D6D;"></i>
								</span>

							</div>
						</div>

						<div class="question-answers">
							<p class="ptilte">全部回复</p>
							<hr />

							<div class="answer-item" v-for="reply in replyList">
								<div class="answer-head">
									<div class="user-avatar ">
										<a class="avatar" href="#" target="_blank">
											<!--  回复人头像 -->
											<img :src="reply.userImg">
										</a>
									</div>
								</div>
								<div class="answer-detail">
									<div class="question-headline">
										<span class="question-figure">{{reply.replyLikenum}} 点赞</span>
									</div>
									<span class="comment-reply">
										<div class="user-username ">
											<a class="username" href="#" target="_blank">{{reply.replyUsername}}</a>
										</div>
									</span>
									<span class="comment-parent" v-if="reply.isReply">
										回复
										<div class="user-username ">
											<a class="username" href="/user/347060" target="_blank">{{reply.byUsername}}</a>
										</div>
									</span>
									<span class="comment-parent" v-else>

									</span>

									<div class="answer-content markdown-body" v-if="reply.isDelete">
										<p>该回复已被删除，不能查看</p>
									</div>
									<div class="answer-content markdown-body" v-else>
										<p v-html="reply.replyContent"></p>
									</div>
									<div>
										<span class="create-time">{{reply.replyTime}}</span>
									</div>
									<div class="labreport-detail-like">
										<!-- 回复 -->
										<span class="btn btn-weiboshare">
											<template>
												<el-button size="mini" type="success" plain @click="replyUser(reply.replyId)">回复</el-button>
											</template>
										</span>

										<!-- 举报 -->
										<span class="btn  btn-weiboshare" v-if="reply.isReport">
											<el-button type="warning" size="mini" disabled>举报</el-button>
										</span>
										<span class="btn  btn-weiboshare" v-else>
											<el-button type="warning" size="mini" @click="reportReply(reply)">举报</el-button>
										</span>

										<!-- 删除 -->
										<span class="btn  btn-weiboshare" v-if="reply.isMy">
											<i class="layui-icon layui-icon-delete" v-on:click="deleteReply(reply)" style="font-size: 20px; color: #CC0033;"></i>
										</span>

										<!-- 点赞 -->
										<span class="btn  btn-weiboshare" v-if="reply.isLike">
											<i class="layui-icon layui-icon-praise" v-on:click="replyLike(reply)" style="font-size: 20px; color: #CC0033;"></i>
										</span>
										<span class="btn  btn-weiboshare" v-else>
											<i class="layui-icon layui-icon-praise" v-on:click="replyLike(reply)" style="font-size: 20px; color: #6D6D6D;"></i>
										</span>
									</div>

									<hr />
								</div>
							</div>

						</div>
						<div class="your-answer words-ctrl">
							<!-- 富文本框位置  -->
							<textarea id="demo" placeholder="输入回复内容"></textarea>

							<br />
							<button class="layui-btn" data-type="content" id="commit">提交回复</button>

						</div>
					</div>

				</div>
				<div class="col-md-3 layout-side">

					<a class="btn side-btn" href="publicPost.html" data-toggle="modal" data-target="#askquestion">我要发帖</a>

					<div class="panel panel-default panel-userinfo">
						<div class="panel-body body-userinfo">
							<div class="media userinfo-header">
								<div class="media-left">
									<div class="user-avatar">

										<a class="avatar" href="#sign-modal" data-toggle="modal" data-sign="signin">
											<img class="circle" src="../img/logo-grey.png">
										</a>

									</div>
								</div>
								<div class="media-body">

									<span class="media-heading username">欢迎来到智慧教育平台</span>
									<p class="vip-remain">做实验，学编程</p>

								</div>
							</div>

							<div class="userinfo-footer row">
								<div class="col-md-6 col-xs-6 pos-left">

									<a href="#sign-modal" data-toggle="modal" data-sign="signin"><span class="glyphicon glyphicon-bookmark"></span>
										加入私有课</a>

								</div>
								<div class="col-md-6 col-xs-6 pos-right">
									<a href="/contribute" target="_blank"><span class="glyphicon glyphicon-send"></span> 我要投稿</a>
								</div>

								<div id="join-private-course" class="modal fade words-ctrl" tabindex="-1" role="dialog">
									<div class="modal-dialog" role="document">
										<div class="modal-content">
											<div class="modal-header">
												<h4 class="modal-title">加入私有课</h4>
											</div>
											<div class="modal-body">
												<div style="margin:15px 0; font:16px;">输入教师提供的私有课程码可以加入教师的私有课程。</div>
												<form id="private-course-form" method="POST" action="/courses/join">
													<div class="form-group">
														<label for="code">邀请码</label>
														<input class="form-control" id="code" name="code" type="text" value="">
														<input name="_csrf_token" type=hidden value="1483789088##bbf83c51243ab12daa94911c8865a65bdc66c4d8">
													</div>
												</form>

											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
												<button type="button" class="btn btn-primary" onclick="document.getElementById('private-course-form').submit();">确定</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<script type="text/javascript">
			if (sessionStorage.getItem("access_token") != null) {
				axios.defaults.headers.common['Authorization'] = "bearer " + sessionStorage.getItem("access_token");
			}

			var postDetails = new Vue({
				el: '#postDetails',

				mounted: function() {
					this.token = sessionStorage.getItem("access_token");
					this.getPostDetails();
					this.queryReply();
					this.userIsPost();

				},
				data() {
					return {
						isLike: "",
						postLike: "",
						postReport: '',
						replynum: '',
						postUsername: '',
						postContent: '',
						postBrowse: '',
						postTime: '',
						isDelete: '',
						isMy: '',
						userImg: '',
						userId: sessionStorage.getItem("userid"),
						replyId: '',
						postTitle: '',
						username: sessionStorage.getItem("username"),
						postId: sessionStorage.getItem("postId"),
						replyList: [],
						token: ''

					}
				},
				methods: {
					sadasd() {

						window.scrollTo(0, document.documentElement.clientHeight);
					},
					queryReply: function() {
						let params = new URLSearchParams();
						params.append("postId", this.postId);
						params.append("loginUserId", this.userId);
						axios({
							method: 'post',
							url: '/api/bbs/reply/getReplyByPostId',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							this.replyList = res;
							console.log('replyList==>' + this.replyList);
						})
					},
					getPostDetails: function() {
						let params = new URLSearchParams();
						params.append("postId", this.postId);
						params.append("userId", this.userId);
						axios({
							method: 'post',
							url: '/api/bbs/post/getPostDetailsByPostId',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							this.postTitle = res.postTitle;
							this.postContent = res.replyContent;
							this.postTime = res.replyTime;
							this.postUsername = res.userName;
							this.postBrowse = res.replyBrowse;
							this.replyId = res.replyId;
							this.replynum = res.replyNum;
							this.replyLikenum = res.replyLikenum;
							this.isMy = res.isMy;
							this.isDelete = res.isDelete;
							this.userImg = res.userImg;
						})
					},
					deletePost: function() {
						let params = new URLSearchParams();
						params.append("replyId", this.replyId);
						params.append("postId", this.postId);
						axios({
							method: 'post',
							url: '/api/bbs/post/deletePost',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							if (res.success) {
								this.$message({
									message: res.message,
									type: 'success'
								});
								this.queryReply();
							} else {
								this.$message.error(res.message);
							}
						})
					},
					deleteReply: function(reply){
						let params = new URLSearchParams();
						params.append("replyId", reply.replyId);
						axios({
							method: 'post',
							url: '/api/bbs/reply/deleteReply',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							if (res.success) {
								this.$message({
									message: res.message,
									type: 'success'
								});
								this.queryReply();
							} else {
								this.$message.error(res.message);
							}
						})
					},
					/* 用户是否举报或点赞该贴 */
					userIsPost: function() {
						let params = new URLSearchParams();
						params.append("replyId", this.replyId);
						params.append("userId", this.userId);
						axios({
							method: 'post',
							url: '/api/bbs/post/userIsPost',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							this.postLike = res.isLikePost;
							this.postReport = res.isReportPost;
						})
					},
					replyLike: function(reply) {
						let params = new URLSearchParams();
						params.append("replyId", reply.replyId);
						params.append("userId", this.userId);
						params.append("isLike", reply.isLike);
						axios({
							method: 'post',
							url: '/api/bbs/reply/replyLike',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							if (res.success) {
								this.$message({
									message: res.message,
									type: 'success'
								});
								this.queryReply();
							} else {
								this.$message.error(res.message);
							}

						})

					},
					replyUser: function(replyId) {
						this.$prompt('请输入回复内容', '回复', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							inputPattern: /\S/,
							inputErrorMessage: '回复内容不能为空'
						}).then(({
							value
						}) => {
							console.log("replyId====>" + replyId);
							let params = new URLSearchParams();
							params.append("replyContent", value);
							params.append("postId", this.postId);
							params.append("pId", replyId);
							params.append("userId", this.userId);
							axios({
								method: 'post',
								url: '/api/bbs/reply/insertReply',
								data: params,
								headers: {
									//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
								}
							}).then(res => {
								res = res.data;
								if (res.success) {
									this.$message({
										message: res.message,
										type: 'success'
									});
									this.queryReply();
								} else {
									this.$message.error(res.message);
								}
							})
						}).catch(() => {
							this.$message({
								type: 'info',
								message: '取消输入'
							});
						});
					},
					reportReply: function(reply) {
						this.$prompt('请输入举报内容', '举报', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							inputPattern: /\S/,
							inputErrorMessage: '举报内容不能为空'
						}).then(({
							value
						}) => {
							let params = new URLSearchParams();
							params.append("replyId", reply.replyId);
							params.append("userId", this.userId);
							params.append("reportReason", value);
							axios({
								method: 'post',
								url: '/api/bbs/reply/userReport',
								data: params,
								headers: {
									//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
								}
							}).then(res => {
								res = res.data;
								if (res.success) {
									this.$message({
										message: res.message,
										type: 'success'
									});
									this.queryReply();
								} else {
									this.$message.error(res.message);
								}

							})

						}).catch(() => {
							this.$message({
								type: 'info',
								message: '取消输入'
							});
						});

					},
					userLikePost: function() {
						if (this.token == null) {
							this.isHaveToken();
						}

						let params = new URLSearchParams();
						params.append("replyId", this.replyId);
						params.append("userId", this.userId);
						params.append("isLike", this.postLike);
						axios({
							method: 'post',
							url: '/api/bbs/reply/replyLike',
							data: params,
							headers: {
								//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
							}
						}).then(res => {
							res = res.data;
							if (res.success) {
								this.$message({
									message: res.message,
									type: 'success'
								});
								this.userIsPost();
							} else {
								this.$message.error(res.message);
							}

						})
					},
					userReportPost: function() {
						this.$prompt('请输入举报内容', '举报', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							inputPattern: /\S/,
							inputErrorMessage: '举报内容不能为空'
						}).then(({
							value
						}) => {
							let params = new URLSearchParams();
							params.append("replyId", this.replyId);
							params.append("userId", this.userId);
							params.append("reportReason", value);
							axios({
								method: 'post',
								url: '/api/bbs/reply/userReport',
								data: params,
								headers: {
									//"Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiLlvKDkuIkiLCJzY29wZSI6WyJhbGwiLCJyZWFkIiwid3JpdGUiXSwiY29tcGFueSI6ImllcCIsImV4cCI6MTU0NDUzMTEzMCwiYXV0aG9yaXRpZXMiOlt7ImF1dGhvcml0eSI6IlJPTEVf5a2m55SfIn0seyJhdXRob3JpdHkiOiLmtYvor5XmnYPpmZAifV0sImp0aSI6IjQyNWQxN2NiLTA1MTEtNGUwNy1iZTBiLTMxNDY1MDYxYzhhYSIsImNsaWVudF9pZCI6ImllcCJ9.4ELHXcBVRxTDYAQP0CBYTTY9mxMqLgJhdFONiH6o_fs"
								}
							}).then(res => {
								res = res.data;
								if (res.success) {
									this.$message({
										message: res.message,
										type: 'success'
									});
									this.userIsPost();
								} else {
									this.$message.error(res.message);
								}

							})

						}).catch(() => {
							this.$message({
								type: 'info',
								message: '取消输入'
							});
						});
					},
					isHaveToken: function() {
						console.log(this.token);
						this.$confirm('您还没有登录账号, 是否登录?', '提示', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							type: 'warning'
						}).then(() => {
							window.location.href = "\\login.html?callback-url=http://127.0.0.1/bbs/Reception/post.html";
							/* this.$message({
								type: 'success',
								message: '登录成功!'
							}); */
						}).catch(() => {
							this.$message({
								type: 'info',
								message: '已取消登录'
							});
							//window.location.href = ""
						});

					}

				}
			})
		</script>


		<!-- 页脚 -->
		<div class="width100 float_l padding_t30 height193">
			<div class="width_1200 margin_auto">
				<div class="width100 float_l text_c margin_b30">
					<a class="img_backg5" href="#"></a>
					<a class="img_backg6 posi_relative wexinmaxianshi" href="#"><i class="weixinweima dis_none"><img src="img/idx-btm.png"></i></a>
					<a class="img_backg7" href="#"></a>
					<a class="img_backg8" href="#"></a>
				</div>
				<div class="width100 float_l text_c yejiao color_gray">
					<a>关于我们</a>
					<a>企业合作</a>
					<a>人才招聘</a>
					<a>讲师招募</a>
					<a>联系我们</a>
					<a>意见反馈</a>
					<a>友情链接</a>
				</div>
				<div class="width100 float_l text_c border_t margin_t20 padding_t20 color_gray fon_siz12">
					<span>© 2016 imoroc.com 京ICP备13042132号</span>
				</div>
			</div>
		</div>

	</body>
</html>
